/**
 * opportunity服务
 *
 * @author sxf
 * @email sxf02615@163.com
 * @date 2025/1/15
 */
package com.sxf.crm.service;


import com.sxf.crm.dto.OpportunityFollowUpDTO;
import com.sxf.crm.dto.OpportunityFollowUpRequest;
import com.sxf.crm.dto.OpportunityDTO;
import com.sxf.crm.entity.Opportunity;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

/**
 * 商机服务接口
 * 
 * <p>处理商机相关的业务逻辑</p>
 * 
 * @author sxf
 * @email sxf02615@163.com
 * @date 2025/6/1
 */
public interface OpportunityService {
    
    Opportunity create(Opportunity opportunity, Long currentUserId);

    Opportunity update(Opportunity opportunity, Long currentUserId);

    Opportunity getById(Long id);

    Page<Opportunity> findAll(Pageable pageable);

    Opportunity claim(Long id, String remark, Long currentUserId);

    Opportunity assign(Long id, Long userId, String remark, Long currentUserId);

    Opportunity recycle(Long id, String recycleReason, Long currentUserId);

    List<OpportunityFollowUpDTO> listByOpportunityId(Long id);

    OpportunityFollowUpDTO addFollowUp(Long id, OpportunityFollowUpRequest request, Long currentUserId);
    
    OpportunityDTO convertToDTO(Opportunity opportunity);

    Opportunity accept(Long id, Long currentUserId);

    Opportunity reject(Long id, String rejectReason, Long currentUserId);

    Opportunity lost(Long id, String lostReason, Long currentUserId);

    Opportunity won(Long id, String remark, Long currentUserId);

    Opportunity negotiating(Long id, String remark, Long currentUserId);

    Opportunity pendingDecision(Long id, String remark, Long currentUserId);

    Opportunity inProgress(Long id, String remark, Long currentUserId);

    Opportunity followedUp(Long id, String remark, Long currentUserId);
    } 